home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-06-19 | 3.2 KB | 131 lines |
- /*
- * Data.java 1.0 12 Jan 1997
- *
- * Copyright (c) 1996 Krumel & Associates, Inc. All Rights Reserved.
- *
- * This software is provided as is. Krumel & Associates shall not be liable
- * for any damages suffered by licensee as a result of using, modifying or
- * distributing this software or its derivatives.
- */
-
- package symantec.itools.db.awt;
-
- import java.awt.Image;
-
- /**
- * Interface defines the API required for classes to provide the values for TableCells
- * stored in a DataSource.
- */
- public interface Data {
- /**
- * Supports string data
- */
- public static final int STRING = 1;
- /**
- * Supports image data
- */
- public static final int IMAGE = 2;
- /**
- * Supports string and image data
- */
- public static final int IMAGE_STRING = 3;
-
- /**
- * Base number for user defined data. All values below this value are reserved for
- * this interface.
- */
- public static final int USER_TYPE = 100;
-
- /**
- * The type of data held by object
- */
- public int type();
-
- /**
- * Can the data be altered by the user.
- */
- public boolean isEditable(int row, int col);
-
- /**
- * Has the data been changed by the user since the last commit
- */
- public boolean changed();
-
- /**
- * Places the data in the state as of the previous commit
- */
- public void rollback();
-
- /**
- * Commits the data to the data source
- */
- public void commit() throws TypeNotSupported;
-
- /**
- * Does the data element support choice selection lists by a cell
- */
- public boolean supportsChoice();
-
- /**
- * Gets the applicable choices for the data element
- * @exception TypeNotSupported Choice lists are not supported by the data element
- */
- public Data[] getChoices() throws TypeNotSupported;
-
- /**
- * Sets the textual value for the data element
- */
- public void setText(String t);
-
- /**
- * Inserts a character into the string value
- * @param pos The position to insert the character
- * @param c The character to insert
- */
- public void insertChar(int pos, char c);
-
- /**
- * Sets the string value of the data element
- */
- public void setText(char c);
-
- /**
- * Appends a character to the string value of the data element
- */
- public void appendChar(char c);
-
- /**
- * Clears all of the text from the string value
- */
- public void clearText();
-
- /**
- * Deletes a character from the string value of the data element
- * @param pos The position of the character to delete
- */
- public void deleteChar(int pos);
-
- /**
- * Gets a substring of the string value of the data element
- * @param spos The starting position of the substring, inclusive
- * @param epos The ending position of the substring, exclusive
- */
- public String subString(int spos, int epos);
-
- /**
- * Sets the image value of the data element
- */
- public void setImage(Image i);
-
- /**
- * Gets the string value for the data element
- */
- public String toString();
-
- /**
- * Gets the image value for the data element
- */
- public Image toImage();
- }
-
-